package com.example.ioc.controller;

import com.example.ioc.model.UserInfo;
import com.example.ioc.service.UserService;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;

@Controller
public class UserController {
//    @Qualifier("userInfo")
//    @Autowired
//    private UserInfo user;

    //不加 s
    @Resource(name = "userInfo")
    private UserInfo user;


//    @Autowired
//    private UserService userService;


    public void sayHi() {
//        userService.doService();
        System.out.println(user);
        System.out.println("hi,user controller");
    }

}
